#include <stdio.h>
int strcpyn(char *s,char *t, int n)
{
   //write your own codes
   int i=0;
   while(s[i]!='\0')
   {
       t[i]=s[n];
       i++;
       n++;
   }
    return 0;
}
int main()
{
	char s[100]={0};
	char t[100]={0};
	int m=0;
	scanf("%s",s);
	scanf("%d",&m);
	strcpyn(s,t,m);
	puts(t);
	return 0;
}
